//
//  MenuXfkjTableViewCell.m
//  土巴兔
//
//  Created by 千锋 on 16/1/8.
//  Copyright (c) 2016年 IOS1503薛凯. All rights reserved.
//

#import "MenuXfkjTableViewCell.h"
#import "UIImageView+WebCache.h"
#import "Default.h"
#import "MenuXfkjModel.h"
@implementation MenuXfkjTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createUI];
    }
    return self;
}
- (void)createUI{
    _label=[[UILabel alloc] initWithFrame:CGRectMake(10, 10, 80, 20)];
    _label.text=@"幸福空间";
    [self.contentView addSubview:_label];
    _moreBtn=[[UIButton alloc] initWithFrame:CGRectMake(260, 10, 50, 20)];
    [self.contentView addSubview:_moreBtn];
    _imageview=[[UIImageView alloc] initWithFrame:CGRectMake(10, 35, DEVICEWIDTH-20, (DEVICEWIDTH-20)*2/3)];
    [self.contentView addSubview:_imageview];
    _context=[[UILabel alloc] initWithFrame:CGRectMake(10, 35+(DEVICEWIDTH-20)*2/3, DEVICEWIDTH-20, 40)];
    _context.numberOfLines=0;
    _context.font=[UIFont systemFontOfSize:16];
    [self.contentView addSubview:_context];
}
- (void)relayoutWithData:(NSMutableArray *)array{
    for (int i=0; i<array.count; i++) {
        [_imageview sd_setImageWithURL:[NSURL URLWithString:((MenuXfkjModel*)array[i]).image]];
        _context.text=((MenuXfkjModel*)array[i]).content;
    }
}
@end
